<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="image/x-icon" rel="shortcut icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>XX网 - 主页</title>

<link rel="stylesheet" href="__APP__/css/themes/base/jquery.ui.all.css" />
<link rel="stylesheet" href="__APP__/css/demos.css" />

<script src="__APP__/js/jquery-1.9.1.min.js"></script>
<script src="__APP__/js/ui/jquery.ui.core.js"></script>
<script src="__APP__/js/ui/jquery.ui.widget.js"></script>
<script src="__APP__/js/ui/jquery.ui.mouse.js"></script>
<script src="__APP__/js/ui/jquery.ui.button.js"></script>
<script src="__APP__/js/ui/jquery.ui.draggable.js"></script>
<script src="__APP__/js/ui/jquery.ui.position.js"></script>
<script src="__APP__/js/ui/jquery.ui.resizable.js"></script>
<script src="__APP__/js/ui/jquery.ui.button.js"></script>
<script src="__APP__/js/ui/jquery.ui.dialog.js"></script>
<script src="__APP__/js/ui/jquery.ui.effect.js"></script>
<script src="__APP__/js/ajaxfileupload.js"></script>

<script src="__APP__/js/string.js"></script>
<script src="__APP__/js/doAddFriend.js"></script>
<script src="__APP__/js/noAddFriend.js"></script>
<script src="__APP__/js/blog.js"></script>
<script src="__APP__/js/image.js"></script>
<script src="__APP__/js/check.js"></script>

<style type="text/css">

.index {
	color: #FFFFFF;
	font-size: 16px;
}
.exit {
	font-size: 12px;
}
.divPhoto{
	width:120px;
	height:120px;
	overflow:hidden;
}
.remind
{
	font-size:14px;
	color:#F60;
}
.remind2
{
	font-size:14px;
	color:#390;
}
a{
	color:#339;
	text-decoration:none
}
image{
	border:none;
}
#preview{
	position:absolute;
	top:150px;
	left:433px;
	border:2px double #CCC;
	background-color:#FFC;	
	display:none;}

.delpic{
	font-size: 12px;
}

fieldset { padding:0; border:0; margin-top:25px; }
.ui-dialog .ui-state-error { padding: .3em; }
.validateTips { border: 1px solid transparent; padding: 0.3em; }

body {
	margin-top:0px;
}
</style>

<script type="text/javascript">
function ajaxFileUpload()
{

	$("#loading")
	.ajaxStart(function(){
		$(this).show();
	})
	.ajaxComplete(function(){
		$(this).hide();
	});

	$("#loading").show();
	
	$.ajaxFileUpload
	(
		{
			url:'__URL__/doajaxfileupload',
			secureuri:false,
			fileElementId:'pic',
			dataType: 'json',
			data:{name:'logan', id:'id'},
			success: function (data, status)
			{  
				$("#loading").hide();
				if(typeof(data.error) != 'undefined')
				{
					if(data.error != '')
					{
						alert(data.error);
					}else
					{	  	
		                  $('#isPicUp').val(data.msg);
		                  var strArr = data.msg+"?rd="+new Date().valueOf();
		                  $('#preview').html("<img src='__APP__/"+strArr+"' onload='resizeImage(this,300,300)' /><div><span class='delpic' onclick='delPic();'><a href='#'>删除</a></span></div>");
						  $('#preview').hide();				  
						  $('#preview').show("slow");	  
					}
				}
			},
			error: function (data, status, e)
			{
				alert(e);
			}
		}
	);
	
	return false;

}

</script>


</head>

<body>
  <div id='head' style='width:100%;height:33px;position:fixed;top:0;left:0;background-color:#90B44b;'>
  <table width="1000" height="29" border="0" cellspacing="0" align="center">
    <tr>
      <td width="160" height="23"><a href="index.php"><img src="__APP__/image/logo.png" width="160" height="31" alt="logo" title="主页"/></td>
      <td width="75" align="center" bgcolor="#90B44b"><a href="index.php"><strong class="index">主页</strong></a></td>
      <td width="162" align="center"><a href="profile.php?uid={$userid}"><strong class="index">个人主页</strong></a></td>
      <td width="96" align="center"><a href="friend.php"><strong class="index">好友</strong></a></td>
      <td width="125" align="center"><a href="game.php"><strong class="index">游戏</strong></a></td>
      <td width="218">
      <form id="SearchForm" name="SearchForm" method="post" action="search.php" onSubmit="return InputCheck(this)">
        <input type="text" name="search" id="search"  style="width:120px;" />
        <input type="submit" name="searchOK" id="searchOK" value="搜索" />
      </form></td>
      <td width="134" class="exit"><a href="__APP__/Public/logout">注销</a></td>
    </tr>
  </table></div>
<div align="center" style="margin-top:33px;">
  <table width="1000" border="0">
    <tr>
      <td width="120"><div id="divPhoto" class="divPhoto"><a href="updatePhoto.php"><img src="__APP__/{$user.photo}" onload="resizeImage(this,120,120)" /></a></div></td>
      <td width="750" align="left">
      <form id="postBlog" name="postBlog" method="post" action="">
        <textarea name="blog" id="blog" cols="80" rows="5"></textarea>
        <input type="button" name="blogOK" id="blogOK" value="发布" />
        
        <div style="margin-top: 5px;"><span class="exit">插入图片：</span><input type="file" name="pic" id="pic" onchange="return ajaxFileUpload();" />
        <img id="loading" style="width:16px;hight:16px;display:none;" src="__APP__/image/loading.gif" />        
        <input type="hidden" id="isPicUp" value="" /></div>
      </form>
       </td>
      <td width="108">&nbsp;</td>
    </tr>
  </table>  
  <table width="1000" border="0">
    <tr bgcolor="#F0F0F0">
      <td width="120" height="223" rowspan="2" bgcolor="#F0F0F0">&nbsp;</td>
      <td width="750" height="31">新鲜事</td>
      <td width="108" rowspan="2">
      
      </td>
    </tr>
    <tr>
      <td ><div id="divMy" style="">
      <div id="divRemind">
      <!--  
      <?php 
      	$num_rows = mysql_num_rows($getRemind);
      	if($num_rows==0)
      	{
      		
      	}
      	else 
      	{
      		$newReplyNum = 0;
      		while($row = mysql_fetch_array($getRemind))
      		{
      			if ($row['type']=="addFriend")
      			{
      				$rid = $row['rid'];
      				
      				$uidFrom =  $row['uidFrom'];
      				$getUserFrom = mysql_query("select * from user where 
					 uid='$uidFrom' limit 1");
					$result = mysql_fetch_array($getUserFrom);
					$usernameFrom = $result['username'];
      				
      				
      				?>
      				<div class="remind2" id="<?=$rid ?>">
      				<a href="profile.php?uid=<?=$uidFrom ?>"><?=$usernameFrom ?></a>请求加您好友 <a href="#" 
      				onclick="doAddFriend(<?="'t=".$uidFrom."&rid=".$rid.",$rid"."'" ?>)">同意</a>   
      				<a href="#" onclick="noAddFriend(<?="'"."rid=".$rid.",$rid"."'" ?>)">忽略</a>
      				<hr>
      				</div>
      				<?php 
      			}
      			else if($row['type']=="reply"||$row['type']=="reReply")
      			{
      				$newReplyNum++;
      			}
      		}
      		if($newReplyNum!=0)
      		{
      			?>
      		      				<div id="newReplyNum">
      		      				<span class="remind">您有 <a style="color:#F00;" href="remind.php"><?=$newReplyNum ?></a> 条新评论 <a href="remind.php">查看</a></span>
      		      				<hr>
      		      				</div>
      		      				<?php     				
      		     }

      	}

      
      ?>-->
      </div>  
      <div id="divNews" style="margin-left:10px; margin-right:10px; margin-top:10px;">
      <if condition='$count eq 0'>
      	暂无新鲜事
      	<else />
      	<volist name="list" id="vo">
      	  <div id="divBlogAll{$vo.bid}" style="width:600px;">
		  <div style="width:50px;float:left;">
		  <a href="profile.php?uid={$vo.uidAuthor}">
		  <img src="__APP__/{$vo.photo|smallPhoto}" onload="resizeImage(this,50,50);" />
		  </a>
		  </div>
		  <div style="text-align:left; padding-left: 0px; margin-left:70px;">
		  <div style="width: 600px;word-break: break-all;" id="contentBlog{$vo.bid}">
		  <p style="font-size:14px; color:#666;">
		  <a href="profile.php?uid={$vo.uidAuthor}">{$vo.username}</a>：{$vo.content}
		  </p>
		  </div>
		  
		  <if condition='$vo.picture neq ""'>
 			<div id="divBlog{$vo.bid}" style="overflow:hidden;cursor:pointer;">
 			<img style="border:2px double #CCC;" id="imgBlog{$vo.bid}" src="__APP__/{$vo.picture}" onload="resizeImage(this,300,300);" onclick="showLarge('Blog{$vo.bid}');" />
			  </div>
		  </if>
 			<div style="margin-top:10px;"><div style=" display:inline-block;"><span style="font-size:12px;"><a href="blog.php?bid={$vo.bid}">发表于 {$vo.btime|date="Y-m-d H:i:s",###}</a></span></div>
			  <div style=" float:right;">
			  <if condition='$vo.uidAuthor eq $userid'>
 				<span style="font-size:12px;cursor:pointer;color:#69F;" id="delBlog{$vo.bid}" onclick="delBlog('{$vo.bid}')" >删除</span>
			  	<span style="font-size:12px;color:#CCC;" >|</span>
			  </if>
			  <span style="font-size:12px;cursor:pointer;color:#69F;" id="forwardingBlog{$vo.bid}" onclick="openLayer('forwardingBlog{$vo.bid}','forwarding','');" >转发</span>
              <span style="font-size:12px;color:#CCC;" >|</span>						  
			  <span id="replyNumBlog{$vo.bid}" style="font-size:12px;cursor:pointer;color:#69F;" onclick="toggleReply(this,'Blog{$vo.bid}');" >
			  评论<if condition='$vo.replyNum neq null'>({$vo.replyNum})</if></span></div>
			  </div>
			  
			  <div id="replyBlog{$vo.bid}" style="margin-top:10px; display:none;border:1px solid #CCC ;"> 
			  <input type="text" id="textReplyBlog{$vo.bid}" style="width:475px;" /><input id="buttonReplyBlog{$vo.bid}" type="button" style="cursor:pointer;" value="评论" onclick="reply('{$vo.bid}');" />
			  <div id="replyContentBlog{$vo.bid}" style="margin-top:10px; margin-left:10px; margin-right:10px;">
			  </div>
			  </div>
			  <input type="hidden" id="hidBlog{$vo.bid}" value="{$vo.picture|pictureOri}" />
			  </div> 
			  </div>
			  <hr id="hr{$vo.bid}" style="border-top:0.5px dotted #CCC;" />	
			  
		</volist>
		<div class="result page" style='float:right;'>{$page}</div>
      </if>
      </div>
      </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</div>

<div id="preview"></div>

<div id="dialog-form" title="转发微博">
	<p class="validateTips">请输入转发内容</p>

	<form>
	<fieldset>
        <div id="tabcontent" style="margin-left:10px;">
        <div id="originalBlog" style="background-color:#CCC; width:380px;"></div>
        <br />
        <textarea name="forwardingContent" id="forwardingContent" cols="51" rows="3" class="text ui-widget-content ui-corner-all"></textarea>
        </div>
	</fieldset>
	</form>
</div>
</body>
</html>
